// @ts-ignore
import { request } from '@/request/request';

/**
 * 获取用户信息.
 * @param data
 */
export const getUserInfo = (data:any): Promise<any> => {
    return request({ url: '/user/detail', data, method: 'GET' })
}

/**
 * 常用门店.
 * @param data
 */
export const getCommonUseStore = (data:any): Promise<any> => {
    return request({ url: '/user/commonUseStores', data, method: 'GET' })
}


/**
 * 获取奖励记录.
 * @param data
 */
export const getRewardRecord = (data:any): Promise<any> => {
    return request({ url: '/user/getRewardRecord', data, method: 'GET' })
}

/**
 * 获取提现记录.
 * @param data
 */
export const getWithdrawalRecord = (data:any): Promise<any> => {
    return request({ url: '/user/getWithdrawalRecord', data, method: 'GET' })
}

/**
 * 发起申请提现.
 * @param data
 */
export const submitWithdrawal = (data:any): Promise<any> => {
    return request({ url: '/user/submitWithdrawal', data, method: 'POSt' })
}

/**
 * 授权头像昵称.
 * @param data
 */
export const authAvatarNickname = (data:any): Promise<any> => {
    return request({ url: '/user/authAvatarNickname', data, method: 'POST' })
}

/**
 * 获取就诊人列表.
 * @param data
 */
export const getPatients = (data:any): Promise<any> => {
    // @ts-ignore
    return request({ url: '/user/patients', data, method: 'GET' })
}

/**
 * 就诊人.
 * @param data
 */
export const getPatient = (data:any): Promise<any> => {
    // @ts-ignore
    return request({ url: '/user/patient', data, method: 'GET' })
}


/**
 * 保存就诊人.
 * @param data
 */
export const savePatient = (data:any): Promise<any> => {
    return request({ url: '/user/savePatient', data, method: 'POST' })
}

/**
 * 就诊记录.
 * @param data
 */
export const getPatientCases = (data:any) => {
    return request({url: '/user/patient/cases', data, method: 'GET'})
}

/**
 * 就诊记录详情.
 * @param data
 */
export const getPatientCaseInfo = (data:any) => {
    return request({url: '/user/patient/case', data, method: 'GET'})
}

/**
 * 用户地址.
 * @param data
 */
export const getAddress = (data:any): Promise<any> => {
    return request({ url: '/user/address', data, method: 'GET' })
}

/**
 * 默认地址.
 */
export const getDefaultAddress = (): Promise<any> => {
    return request({ url: '/user/defaultAddress', data:{}, method: 'GET' })
}

/**
 * 保存用户地址.
 * @param data
 */
export const saveAddress = (data:any): Promise<any> => {
    return request({ url: '/user/saveAddress', data, method: 'POST' })
}

/**
 * 地址详情.
 * @param data
 */
export const getAddressInfo = (data:any) => {
    return request({ url: '/user/addressInfo', data, method: 'GET' })
}


/**
 * 删除地址.
 * @param data
 */
export const deleteAddress = (data:any): Promise<any> => {
    return request({ url: '/user/deleteAddress', data, method: 'POST' })
}

